<template>
	<article class="col-7 fl">
		
		<div>
			作业描述：3.14号作业
		</div>
		
	  <div class="u-r-cont">
	    作业上传
		<el-upload
		  class="upload-demo"
		  action="http://localhost:8110/upload"
		   accept=".pdf"
		  :on-preview="handlePreview"
		   :on-exceed="handleExceed"
		   :before-remove="beforeRemove"
		   :on-remove="handleRemove"
		  :limit="10"
		  >
		  <el-button size="small" type="primary">点击上传</el-button>
		  <div slot="tip" class="el-upload__tip">只能上传pdf文件，且不超过100mb</div>
		</el-upload>
		
	  </div>
	</article>
</template>

<script>
	export default {
	    data() {
	      return {
	      };
	    },
	    methods: {
	            handlePreview(file){
					window.open(file.response.url);
				},
				  handleExceed(files, fileList) {
				        this.$message.warning(`当前限制选择 10 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
				      },
					  beforeRemove(file, fileList) {
					          return this.$confirm(`确定移除 ${ file.name }？`);
					        }
	    }
	  }
</script>

<style>
</style>
